# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Chirantan Ekbote <ekbotec at chromium.org>
# Contributer: Doug Newgard <scimmia22 at outlook dot com>
# Contributer: Stéphane Gaudreault <stephane.gaudreault@gmail.com>

pkgname=tolua++
pkgver=1.0.93
pkgrel=4
pkgdesc="Tool to integrate C/C++ code with Lua"
arch=('loong64' 'x86_64')
url="https://github.com/LuaDist/toluapp"
license=('MIT')
depends=('lua51')
makedepends=('cmake' 'git')
options=('staticlibs')
source=(git+https://github.com/LuaDist/toluapp.git#tag=${pkgver})
sha512sums=('SKIP')

build() {
    cd toluapp

    rm -rf build && mkdir build
    cd build

    cmake -DCMAKE_INSTALL_PREFIX=/usr ..
}

package() {
    cd toluapp/build

    make DESTDIR="${pkgdir}" install

    # install license files
    install -Dm644 "$srcdir/toluapp/COPYRIGHT" "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
}
